package koction.model.consumer;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
@Repository
public class ConsumerDaoImpl implements ConsumerDao {
	@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;

	@Override
	public ConsumerVO findById(String id) {
		return sqlSessionTemplate.selectOne("consumer.findById",id);
	}

	@Override
	public int registerConsumer(ConsumerVO cvo) {
		return sqlSessionTemplate.insert("consumer.registerConsumer",cvo);
	}

	@Override
	public int updateConsumer(ConsumerVO cvo) {
		return sqlSessionTemplate.update("consumer.updateConsumer",cvo);
	}

	@Override
	public ConsumerVO loginConsumer(ConsumerVO cvo) {
		return sqlSessionTemplate.selectOne("consumer.loginConsumer",cvo);
	}

	@Override
	public int deleteConsumer(ConsumerVO cvo) {
		return sqlSessionTemplate.delete("consumer.deleteConsumer",cvo);
	}
	
}
